# Maintainer: ovf <ovf@mm.st>
pkgname=vcmi
pkgver=1.5.7
pkgrel=0
pkgdesc="Open-source engine for Heroes of Might and Magic III"
url="https://vcmi.eu"
# ppc64le, riscv64, loongarch64: no luajit
# game engine
arch="aarch64 x86_64"
license="GPL-2.0-or-later"
makedepends="
	boost-dev
	cmake
	ffmpeg-dev
	fuzzylite-dev
	luajit-dev
	minizip-dev
	onetbb-dev
	qt6-qtbase-dev
	qt6-qttools-dev
	samurai
	sdl2-dev
	sdl2_image-dev
	sdl2_mixer-dev
	sdl2_ttf-dev
	zlib-dev
	"
source="https://github.com/vcmi/vcmi/archive/refs/tags/$pkgver/vcmi-$pkgver.tar.gz"

build() {
	cmake -B build -G Ninja -Wno-dev \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_DISABLE_PRECOMPILE_HEADERS=ON \
		-DCMAKE_BUILD_TYPE=None \
		-DFORCE_BUNDLED_FL=OFF \
		-DFORCE_BUNDLED_MINIZIP=OFF \
		-DENABLE_INNOEXTRACT=OFF
	cmake --build build
}

check() {
	ctest --test-dir build --output-on-failure
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
40148acd6499e8f6cb37bbdaabedc1260ff76da33034c9a4c26a420da2502eff34623c0792a6c7748b7a66bc03aedcd8c3c641079040690f2fa4069034973737  vcmi-1.5.7.tar.gz
"
